﻿
@{
    ViewData["Title"] = "AddProcess";
    Layout = "~/Views/Home/Main.cshtml";
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
 
  @*   <link rel="stylesheet" href="/layui.css"> *@ <!-- 确保layui的CSS路径正确 -->
    <style>
        .form-container {
            width: 80%;
            margin: 0 auto;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        .layui-form-item {
            margin-bottom: 20px;
        }

            .layui-form-item .layui-inline {
                margin-right: 20px; /* 为每个内联元素添加右边距 */
            }

            .layui-form-item .layui-input-block {
                margin-left: 0; /* 移除单选按钮块的左边距 */
            }

            .layui-form-item:last-child {
                margin-bottom: 0; /* 移除最后一个表单项的底部边距 */
            }

        .layui-btn {
            margin-right: 10px; /* 为提交按钮添加右边距 */
        }
    </style>
</head>
<body>
    <div class="form-container">
        <form class="layui-form" action="">
            <div class="layui-form-item">
                <h1>基本信息</h1>
                <div class="layui-inline">
                    <label class="layui-form-label">工艺路线编号</label>
                    <div class="layui-input-inline">
                        <input type="text" id="ProcessNo" name="ProcessPouteNumber" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">工艺路线名称</label>
                    <div class="layui-input-inline">
                        <input type="text" id="ProcessRouteName1" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
        </div>
            <div class="layui-form-item">
                <label class="layui-form-label">状态</label>
                
                <div class="layui-input-inline">
                  
                    <input type="radio" name="State" value="false" title="启用" checked>
                    <input type="radio" name="State" value="true" title="禁用">
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">成品名称</label>
                    <div class="layui-input-inline">
                        <input type="text" id="ProductName1" autocomplete="off" lay-verify="required" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
               
                <div class="layui-inline">
                    <label class="layui-form-label">创建时间</label>
                    <div class="layui-input-inline">
                        <input type="date" id="CreatedDate1" autocomplete="off" lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">创建人</label>
                    <div class="layui-input-inline">
                        <input type="text" id="CreatedB1" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                
             @*   <h1>加入工序</h1>
                <input type="button" value="新增" class="layui-btn layui-bg-blue" id="DeviceTan" />
                <div class="layui-input-block" id="textBoxContainer"></div> *@
                <input type="button" value="新增" class="layui-btn layui-bg-blue" id="DeviceTan" />
                <div class="layui-input-block">
                    
                    <div class="layui-input-inline">
                        <input type="text" id="process1" autocomplete="off" lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-container">
                        <h4>工序信息</h4>
                        <form class="layui-form" method="post">
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">工序编号</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="ProductionProcessesNum" name="ProductionProcessesNumber" required lay-verify="required"  class="layui-input">
                                    </div>
                                    <label class="layui-form-label">工序分类</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="ProductioType" name="ProductionProcessesType" required lay-verify="required"  class="layui-input">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">工序说明</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="SpecNotes" name="SpecNotes" class="layui-input">
                                    </div>
                                    <label class="layui-form-label">工序名称</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="ProductionNotes" name="ProductionProcessesName" required lay-verify="required"  class="layui-input">
                                    </div>
                                </div>
                     
                            </div>

                        </form>
                    </div>

                </div>
            </div>
           
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="submit" id="allocationProcess" class="layui-btn" lay-submit lay-filter="formSubmit">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary" onclick="location.href='/Process/ShowProcess'">重置</button>
                </div>
            </div>
            <div class="layui-form-item">
                <div>
                    <input type="button" value="添加质检组" class="layui-btn layui-bg-blue" />
                </div>

                <div class="layui-inline">

                    <div class="layui-input-block">
                        <label class="layui-form-label">检验组：</label>
                        <select id="Qualitygroups" lay-filter="mySelectFilter" onclick="xianshi()"></select>
                    </div>
                </div>
                <div>
                    <input type="button" id="allocationProcess1" value="新增质检项目" class="layui-btn layui-bg-blue" />
                </div>
            </div>
        </form>
        <script src="~/js/Process/AddProce.js"></script>

    </div>

   @* <script>
         // 用于存储文本框元素的数组
        let textBoxes = [];

        // 初始化文本框计数器
        let textBoxCounter = 1;

        // 获取“新增”按钮
        const addButton = document.getElementById('DeviceTan');

        // 为“新增”按钮添加点击事件监听器
        addButton.addEventListener('click', function() {
            // 创建新的文本框元素
            const newTextBox = document.createElement('input');
            newTextBox.type = 'text';
            newTextBox.className = 'layui-input'; // 应用LayUI的输入框样式
            newTextBox.placeholder = '请点击以反填数据'; // 设置占位符

            // 生成唯一的ID并设置给文本框
            const newId = `textBox${textBoxCounter++}`;
            newTextBox.id = newId;
            localStorage.setItem("newId",newTextBox.id)
            // 将新文本框添加到数组中
            textBoxes.push(newTextBox);

            // 获取文本框容器
            const container = document.getElementById('textBoxContainer');

            // 将新的文本框添加到容器中
            container.appendChild(newTextBox);

            // 为新文本框添加点击事件监听器
            newTextBox.addEventListener('click', function() {
                // 根据文本框的ID或其他属性反填数据
                // 这里我们简单地使用文本框的ID作为示例数据
                const filledData = localStorage.getItem("productionProcessesName");
                this.value = filledData; // 设置文本框的值
            });
        });
   </script> *@
</body>
</html>

